package service.impl;

import dao.IOrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Orders;
import service.IOrderService;

import java.util.List;

@Service
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private IOrderDao orderDao;

    public List<Orders> getOrderByPid(int pid) {
        return orderDao.getOrderByPid(pid);
    }

    @Override
    public boolean saveOrder(Orders o) {
        return orderDao.saveOrder(o) > 0;
    }

    @Override
    public boolean deleteOrder(int oid) {
        return orderDao.deleteOrder(oid) > 0;
    }
}
